<template>
	<view id="action">
		<my-header :title="title" :back="true"></my-header>
		<view style="margin-top: 60px;">
			<view v-if="!listData.length" class="noneContent">
				暂无相关内容
			</view>
			<uni-card v-else class="list" :title="(current - 1) * 10 + index+1 + '.' + item.projectName" v-for="(item, index) in listData" @tap="itemDetail(item)">
				<view class="twoLine">
					<uni-icons type="calendar-filled" size="16" color="#a6a6a6"></uni-icons>
					<view style="padding-left: 5px;">发布时间：{{item.releaseTime}}</view>					
				</view>
			</uni-card>
		</view>
		<uni-pagination v-if="listData.length" :total="total" @change="changePage" style="padding: 0 10px;" />
	</view>
</template>
/
<script>
	import MyHeader from '@/components/header.vue'
	export default {
		components: {
			MyHeader,
		},
		data() {
			return {
				title: '政策导览',
				total: 0,
				current: 1,
				listData: [],
				query: {
					page: 1,
				},
				range: [
					{ value: '招商引资', text: "招商引资" },
					{ value: '增值扩产', text: "增值扩产" },
					{ value: '科研创新', text: "科研创新" },
					{ value: '人才引育', text: "人才引育" },
					{ value: '专精特新', text: "专精特新" },
					{ value: '智改数转', text: "智改数转" },
					{ value: '载体建设', text: "载体建设" },
					{ value: '安全生产', text: "安全生产" },
					{ value: '其他', text: "其他" },
				],
			}
		},
		onLoad(e) {
			console.log(e, 'e')
			this.query.category = e.category
			this.query.projectName = e.projectName
		},
		created() {
			this.init()			
		},
		methods: {
			init() {
				uni.showLoading({
					title: '加载中'
				});
				uni.request({
					url: '/sf_enterprise_service/business/anonpolicy/queryPage',
					method: 'GET',
					data: this.query,
					success: (res) => {		
						console.log(res, 'res??')
						if(res.data.data.list.length) {	
							this.listData = res.data.data.list
							this.total = res.data.data.totalCount
							console.log(this.listData)
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							})
						}
					},
					complete: () => {							
						uni.hideLoading();
					}
				})
			},
			changePage(e) {
				console.log(e)
				this.current = e.current
				this.query.page = e.current
				this.init()
			},
			itemDetail(item) {
				uni.navigateTo({
					url: '/pages/policeGuide/guideDetail?id=' + item.id
				})
			}
		}
	}
</script>

<style scoped>
.list {
	border-left: 4px solid #1b87eb;
}
.twoLine {
	/* border: 1px solid red; */
	display: flex;
	color: #a6a6a6;
	font-size: 12px;
}
.serchSelect {
	display: flex;
	padding: 0 15px;;
}
.noneContent {
	text-align: center;
	padding-top: 30vh;
}
</style>


